<?php
class histoFilter extends sfFilter {
	public function execute($filterChain) {

		$context = $this->getContext();
		$request = $context->getRequest();

		if($this->isFirstCall()) {

			$hc = new HistoConnexions();
			$hc->setAdresseIp($request->getHttpHeader ('addr','remote'));
			$hc->setIdMembre(1);
			$hc->setEnvt($context->getConfiguration()->getEnvironment());
			$hc->setApp($context->getConfiguration()->getApplication());
			$hc->setModule($context->getModuleName());
			$hc->setAction($context->getActionName());
			$hc->save();
		}

		$filterChain->execute();
	}
}